package HomeWork.Chapter04;

/**
 * Enjoy programming!!!
 * Time: 2021/11/23 -  16:03
 */
public class Narcissus {
    public static void main(String[] args) {
        System.out.println("三位数的水仙花数为：");
        for (int i = 100; i < 1000; i++) {
            if (i == (Math.pow(i / 100, 3) + Math.pow((i / 10) % 10, 3) + Math.pow((i % 10 ), 3) ))
            {
                System.out.printf("%d  ",i );
            }
        }
    }
}
